package com.cyy.demo.test.thread;

public class Service {


    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        String order = getOrder("1");
        String points= getPoints("1");
        System.out.println("共耗时："+ (System.currentTimeMillis() - start));
    }

    public static String getOrder(String orderNo){
        System.out.println("开始获取订单");
        long start = System.currentTimeMillis();
        try {
            Thread.sleep(1500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单耗时："+ (System.currentTimeMillis() - start));
        return "1000";

    }

    public static String getPoints (String pointsNo){
        System.out.println("开始获取积分");
        long start = System.currentTimeMillis();
        try {
            Thread.sleep(1200);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("积分耗时："+ (System.currentTimeMillis() - start));
        return "1000";
    }


}
